﻿using System;
using System.Diagnostics.Contracts;

namespace CashFlow.Entities
{
	public class Tenant
	{
		public string Id { get; set; }
		public string PublicId { get; set; }
		public DateTime InitialBalanceDate { get; set; }
		public double InitialBalanceAmount { get; set; }

		public Tenant()
		{
			InitialBalanceDate = DateTime.UtcNow;
		}

		public Tenant(string id) : this()
		{
			Contract.Requires<ArgumentNullException>(!string.IsNullOrEmpty(id), "tenant id cannot be neither null nor empty.");
			Id = id;
		}

		/// <summary>
		/// Gets a default tenant.
		/// </summary>
		/// <returns>The default instance of the <see cref="T:Tenant"/> class.</returns>
		public static Tenant GetDefault()
		{
			var tenant = new Tenant
			{
				Id = "1"
			};

			return tenant;
		}
	}
}
